// pages/unionSeller/unionSeller.js
const app = getApp()
const util = require('../../utils/util.js');
const api = require('../../utils/api.js');
Page({
    data: {
        unionList:[]
        
    },
    onLoad: function (options) {
        var that = this;
        let url = api.alliance();
        util.http(true,"GET",url,"null",res=>{
            for (let i = 0; i < res.shop_list.length;i++){
                if (res.shop_list[i].star_time == null || res.shop_list[i].end_time == null){
                    res.shop_list[i].star_time = '';
                    res.shop_list[i].end_time = '';
                }else{
                    res.shop_list[i].star_time = util.formatTime(new Date(parseInt(res.shop_list[i].star_time) * 1000));
                    res.shop_list[i].end_time = util.formatTime(new Date(parseInt(res.shop_list[i].end_time) * 1000));
                }
            }
            that.setData({
                unionList: res.shop_list
            })
        })
    },
    onReady: function () {
        util.setNavigationBarTitle("联盟商家");
    },
})